package com.interface_;


//接口可以弥补单继承之外的一些东西
//
public class ExtendsVsInterface {
    public static void main(String[] args) {
        littleMonkey wukong = new littleMonkey("孙悟空");

        wukong.Swim();
        wukong.Fly();
    }
}



class Monkey {
    private String name;

    public Monkey(String name) {
        this.name = name;
    }

    public String Climb() {
        return this.name + "会攀爬";
    }

}


interface Fish {
    void Swim();
}

interface Bird {
    void Fly();
}

class littleMonkey extends Monkey implements Fish, Bird{
    littleMonkey(String name) {
        super(name);
    }

    @Override
    public void Swim() {
        System.out.println(super.Climb() + "  并学会了游泳");
    }


    @Override
    public void Fly() {
        System.out.println(super.Climb() + "  并学会了飞翔");
    }
}



